package Year2021.month10.Day21.Day25;

public class Triangle extends Figure {
    public double a;//第一条边的长度;
    public double b;//第二条边的长度;
    public double c;//第三条边的长度;
    public double p;//周长

    @Override
    public double workPerimeter() {
        p=a+b+c;
        return p;
    }

    @Override
    public double workArea() {
        double p1=this.workPerimeter()/2;
        double area=Math.sqrt(p1*(p1-a)*(p1-b)*(p1-c));
        return area;
    }
}
